// @flow

import React from "react"

import { storiesOf } from "@storybook/react"
import { action as actionAddon } from "@storybook/addon-actions"

import Annotator from '../Annotator'

const middlewares = [
  (store) => (next) => (action) => {
    actionAddon(action.type)(action)
    return next(action)
  },
]

storiesOf("Development", module)
  .add("Basic", () => (
    <Annotator
      hideHistory
      enabledTools={['select', 'pan', 'zoom', 'show-tags', 'create-polygon']}
      headerItems={[{
        name: '下一组',
        icon: <div>icon</div>,
        callback: () => {}
      }]}
      onExit={() => {}}
      middlewares={middlewares}
      regionTagList={["tag1", "tag2", "tag3"]}
      images={[
        {
          src: "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1971525978,455276806&fm=26&gp=0.jpg",
          name: "Image 1",
          regions: []
        }
      ]}
    />
  ))
